home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
pxewin.zip
/
PXDEF.HPP
< prev
next >
Wrap
Text File
|
1992-02-04
|
5KB
|
158 lines
// PXEWIN - (C) Copyright 1992 by Beam Engineering, INC.
// PXDEF.HPP //
// Contents ----------------------------------------------------------------
//
// This module contains definitions that are used throughout the PX
// engine class library. The module definitions are:
//
// 1. Create_Mode. Indicates how the table is to be opened.
//
// 2. PXEWIN_ERR. These are error codes exclusive of PDOX Engine
// error codes and are added for PXEWIN error related problems.
//
// 3. CLOSURE. Indicates whether a specific entity is opened or
// closed. This is useful for determining if a table or record
// buffer is opened or closed.
//
// 4. DATES. This structure is used for storing and retrieving date
// related fields from the Engine.
//
// 5. Additional typedef's for DLL compatible pointer assignments.
//
// End ---------------------------------------------------------------------
// External Reference name for this header ---------------------------------
#ifndef PXDEF_HPP
#define PXDEF_HPP
// End ---------------------------------------------------------------------
// enum Create_Mode //
enum Create_Mode
{
NOTEXISTS, /* Use this only to bail out of
loading a database */
EXISTS, /* Use this mode code when opening
a table that already exists */
OVERWRITE, /* This will overwrite an existing
table with a new one */
CREATE /* Create a new table from scratch */
};
// Description -------------------------------------------------------------
//
// Use these mode codes to open a table in the proper mode.
//
// End ---------------------------------------------------------------------
// enum PXEWIN_ERR //
enum PXEWIN_ERR
{
PXEWSUCCESS, /* Successful operation */
PXEWERR_TBLNOTEXIST, /* An attempt was made to open a
table that does not exist */
PXEWERR_TBLEXIST, /* An attempt was made to create a
table that exists */
PXEWERR_COULDNTOPENTBL /* Couldn't not open table */
};
// Description -------------------------------------------------------------
//
// These are a set of error codes that are unique to the PXEWIN
// library and are exclusive of the PXENGINE error codes. The
// associated error is set in the PXError class.
//
// End ---------------------------------------------------------------------
Pchar EWinMsg[] =
{
NULL, /* PXWSUCCESS */
"This table does not exist.", /* PXEWERR_TBLNOTEXIST */
/* PXEWERR_TBLEXIST */
"Cannot Create a Table that Exists.",
"Cannot open this table." /* PXERR_COULDNTOPENTBL */
};
// Description -------------------------------------------------------------
//
// These messages coorespond to error codes sent by PXEWIN.
//
// End ---------------------------------------------------------------------
// enum ERR_ORIGN //
enum ERR_ORIGIN
{
ENG_ERROR, /* Associated error comes from
the engine error codes */
EWIN_ERROR /* Error comes from PXEWIN associated
error. */
};
// Description -------------------------------------------------------------
//
// This enum is used to identify the origin of the error. Since the
// engine has it's own set of error codes and Borland may be adding
// a more extensive collection of errors in the future, it's probably
// best to seperate errors associated with this library from errors
// caused by engine function calls. PXEWIN keeps track of this by
// using this enum to identify where the error came from.
//
// End ---------------------------------------------------------------------
// enum CLOSURE //
enum CLOSURE
{
CLOSED, /* On entering a constructor, CLOSURE
is set. If the operation within
the constructor is successful,
then OPENED is set. */
OPENED
};
// Description -------------------------------------------------------------
//
// This sets the close_status of each operation to the correct value.
//
// End ---------------------------------------------------------------------
// struct DATES //
typedef struct DATES
{
int day; /* Julian day */
int month; /* Julian month */
int year; /* Julian year */
DATE date; /* Raw long date data */
}DATES;
typedef DATES _FAR *PDATES; /* DLL compatible DATES pointer */
// Description -------------------------------------------------------------
//
// This structure is for encoding and decoding date data from the
// Paradox table. It also provides a further type distinction between
// long numbers and DATE which are of the same type.
//
// End ---------------------------------------------------------------------
// Here are some addition DLL compatible pointer types you may/will need:
typedef double _FAR *Pdouble;
typedef float _FAR *Pfloat;
typedef long _FAR *Plong;
typedef short _FAR *Pshort;
typedef char _FAR **PPchar;
typedef char (_FAR *ErrFunc)(void); /* Engine Return error string
function. This will be set so
that the correct error function
is used depending on whether the
error comes from the engine or
PXEWIN. */
#endif // PXDEF_HPP //